package com.yenlien.traceyun.control.entity;

import com.yenlien.traceyun.webase.entity.BaseEntity;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.experimental.Accessors;
import org.springframework.format.annotation.DateTimeFormat;

import javax.persistence.*;
import java.util.List;

/**
 * 授权管理
 */
@Entity
@Table(name = "t_control_accredit")
@Data
@Accessors(chain = true)
@AllArgsConstructor
@NoArgsConstructor
public class Accredit extends BaseEntity {
    @Column(name = "accreditName", length = 50)
    private String accreditName;                    //授权名字

    private String companyId;

    @Column(name = "accreditTime", length = 50)
    @DateTimeFormat(pattern = "yyyy-MM-dd")
//    @Temporal(TemporalType.DATE)
    private String accreditTime;                      //授权日期

    @Column(name = "accreditExpire", length = 50)
    @DateTimeFormat(pattern = "yyyy-MM-dd")
//    @Temporal(TemporalType.DATE)
    private String accreditExpire;                     //授权到期

    @Column(name = "contentImg", length = 100)
    private String contentImg;                        //授权图片

    @Column(name = "companyNum", length = 20)
    private String companyNum;                         //企业数量

    @Transient
    private List<AccreditCompany> list;
}
